﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using BEPUphysics.Entities.Prefabs;

namespace The_LarX
{
    public class BepuEntity_Sphere: BepuEntity
    {
        public float Radius
        {
            get
            {
                Sphere s = (Sphere)Entity;
                return s.Radius;
            }
            set
            {
                Sphere s = (Sphere)Entity;
                s.Radius = value;
            }
        }
        
        public override Vector3 Scale
        {
            get { return new Vector3(Radius); }
            set { Radius = Vector3Util.Average(value); }
        }

        public BepuEntity_Sphere()
            : base()
        {
            this.Entity = new Sphere(Vector3.Zero, 1);
            BepuPhysics.ActualBepuPhysics.Space.Add(this.Entity);
            this.Immovable = true;
        }
    }
}
